package com.ckr.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Shadowckr
 * @create 2022-01-27 11:46
 */

@RestController
public class ConfigClientController {
    //参照gitee上的config-provider-client.yml文件注入进去
    @Value("${spring.application.name}")
    private String applicationName;

    @Value("${eureka.client.service-url.defaultZone}")
    private String eurekaServer;

    @Value("${server.port}")
    private String port;

    //如果能打印出来这段话证明成功
    @RequestMapping("/config")
    public String getConfig() {
        return "applicationName:" + applicationName +
                " eurekaServer:" + eurekaServer +
                " port:" + port;
    }

}
